import java.util.*;
import javax.swing.*;

public class GuessNumberUsinBreak {
    public static void main(String[] args) {
        int num = (int)(Math.random() * 101);
        
        Scanner scanner = new Scanner(System.in);
        System.out.println("Uzmini maģisko skaitli no 0 līdz 100: ");
        
        while(true) {
            System.out.print("\n:: ");
            int guess = scanner.nextInt();
            
            if(guess == num)
                JOptionPane.showMessageDialog(null, "Uzminēji!");
            else if(guess > num)
                JOptionPane.showMessageDialog(null, "Zemāk!");
            else if(guess < num)
                JOptionPane.showMessageDialog(null, "Augstāk!");
        }
    }
}